package com.fruitshop.info.manager.controller;

import com.fruitshop.info.manager.service.ManagerService;

import java.util.Scanner;
/**
 1.程序的管理员业务员类,用于业务员登录的方法
*/
@SuppressWarnings("all")
public class ManagerController {
    Scanner sc = new Scanner(System.in);
    ManagerService service = new ManagerService();
    FruitController fruitController = new FruitController();

    public void start() {
        System.out.println("请输入用户名:");
        String name = sc.next();
        System.out.println("请输入密码:");
        String passWord = sc.next();

        boolean result = service.login(name, passWord);
        if (result) {
            System.out.println("欢迎您:" + name);
            fruitController.start();
        } else {
            System.err.println("不要皮,你不是管理员!");
        }
    }
}
